import { useStore } from "@/stores/index1";
const store = useStore();
// import global from "@/utils/global.data.params";
// import { storeToRefs } from "pinia";
// import { useStoreData } from "@/stores/data";
// const storeData = useStoreData();
// import { ref } from "vue";
import storages from "./storage";
/**
 * 关闭右键菜单
 * @author scw 2024-2-1 10:19:06
 */
export function closeContextMenu() {
    if (store.contextMenu.isShow) {
        store.contextMenu.isShow = false;
        store.handleMenuData = "";
    }
}
/**
 * 标绘开始编辑
 * @author scw 2024-2-2 11:59:21
 */
export function graphicStartEditing() {
    closeContextMenu();
    // 进入编辑状态
    const graphic = storages.get(storages.get("graphicId"));
    if (graphic) {
        // 打开编辑框
        store.$patch({
            property: true,
        });

        graphic.startEditing();
    }
}
/**
 * 标绘结束编辑
 * @author scw 2024-2-2 12:01:12
 */
export function graphicStoptEditing() {
    // store.property = false;

    if (storages.get("graphicId")) {
        const graphic = storages.get(storages.get("graphicId"));
        if (graphic) {
            store.$patch({
                property: false,
            });
            graphic.stopEditing();
        }
    }
    //
}
